package com.hospital.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Date;

@Data
public class Patient {
    @NotNull(message = "id不得为空")
    private int patient_id;

    @NotEmpty(message = "password不得为空")
    private String patient_password;

    @NotEmpty(message = "name不得为空")
    private String patient_name;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @NotNull(message = "出生日期不得为空")
    private Date patient_birth;

    @NotNull(message = "gender不得为空")
    private int patient_gender;

    @NotEmpty(message = "phone不得为空")
    @Pattern(regexp = "\\d{11}", message = "电话格式错误")
    private String patient_phone;

    @NotEmpty(message = "身份证号不得为空")
    @Pattern(regexp = "\\d{17}(\\d|[X])", message = "身份证格式错误")
    private String patient_idcard;

    @NotNull(message = "是否结婚不得为空")
    private int patient_marry;

    @NotNull(message = "优先级不得为空")
    private int patient_priority;

    @NotNull(message = "是否为黑名单不得为空")
    private int patient_block;
}
